package org.sword.wechat4j.response;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import org.sword.wechat4j.annotation.XStreamCDATA;
import org.sword.wechat4j.type.MsgType;

import java.util.List;


/**
 * @author sean
 */
@XStreamAlias("xml")
public class WechatResponse {

	@XStreamCDATA
	private String ToUserName;
	@XStreamCDATA
	private String FromUserName;
	private Long CreateTime;
	@XStreamCDATA
	private String MsgType;
	@XStreamCDATA
	private String Content;
	/**
	 * max:10
	 */
	private Integer ArticleCount;

	private ImageResponse Image;
	private VoiceResponse Voice;
	private VideoResponse Video;
	private MusicResponse Music;

	@XStreamAlias("item")
	private List<ArticleResponse> article;

	private TransferCustomerServiceResponse TransInfo;
	
	public String getToUserName() {
		return ToUserName;
	}
	public void setToUserName(String toUserName) {
		ToUserName = toUserName;
	}
	public String getFromUserName() {
		return FromUserName;
	}
	public void setFromUserName(String fromUserName) {
		FromUserName = fromUserName;
	}
	public Long getCreateTime() {
		return CreateTime;
	}
	public void setCreateTime(Long createTime) {
		CreateTime = createTime;
	}
	public String getMsgType() {
		return MsgType;
	}
	public void setMsgType(String msgType) {
		MsgType = msgType;
	}
	public String getContent() {
		return Content;
	}
	public void setContent(String content) {
		setMsgType(org.sword.wechat4j.type.MsgType.text.name());
		Content = content;
	}
	public Integer getArticleCount() {
		return ArticleCount;
	}
	public void setArticleCount(Integer articleCount) {
		ArticleCount = articleCount;
	}

	public ImageResponse getImage() {
		return Image;
	}
	public void setImage(ImageResponse image) {
		setMsgType(org.sword.wechat4j.type.MsgType.image.name());
		Image = image;
	}
	public VoiceResponse getVoice() {
		return Voice;
	}
	public void setVoice(VoiceResponse voice) {
		setMsgType(org.sword.wechat4j.type.MsgType.voice.name());
		Voice = voice;
	}
	public VideoResponse getVideo() {
		return Video;
	}
	public void setVideo(VideoResponse video) {
		setMsgType(org.sword.wechat4j.type.MsgType.video.name());
		Video = video;
	}
	public MusicResponse getMusic() {
		return Music;
	}
	public void setMusic(MusicResponse music) {
		setMsgType(org.sword.wechat4j.type.MsgType.music.name());
		Music = music;
	}
	public List<ArticleResponse> getArticle() {
		return article;
	}
	public void setArticle(List<ArticleResponse> article) {
		setMsgType(org.sword.wechat4j.type.MsgType.news.name());
		this.article = article;
	}
	public TransferCustomerServiceResponse getTransInfo() {
		return TransInfo;
	}
	public void setTransInfo(TransferCustomerServiceResponse transInfo) {
		setMsgType(org.sword.wechat4j.type.MsgType.transfer_customer_service.name());
		this.TransInfo = transInfo;
	}
}
